<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/9/28 0028
 * Time: 下午 8:29
 */
$line = 1;
while($line <= 5){
    $empty_pos = $star_pos = 1;
    $empty = 5 - $line;
    $star = 2*$line-1;
    while($empty_pos <= $empty){
        echo '&nbsp;';
        ++$empty_pos;
    }
    while ($star_pos <= $star){
        echo '*';
        ++$star_pos;
    }
    echo '<br>';
    ++$line;
}